﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using XinHeWechat.Common;

namespace XinHeWechat.Api.Controllers
{
    public class HomeController : Controller
    {
        // GET: Home
        public string Index(string signature, string timestamp, string nonce, string echostr)
        {
            string token = "lkjoiuwer";

            var list = new List<string> { timestamp, nonce, token };
            string newStr = string.Concat(list.OrderBy(p => p));

            string newStrSha1 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(newStr, "SHA1");

            return echostr;
        }
    }
}